package 多线程;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class t3 {
    public static void main(String[] args) {
        //有返回值的线程创建方法
        FutureTask<Integer> task = new FutureTask<>(new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                System.out.println("新线程");
                return null;
            }
        });
        Thread t =new Thread(task);
        t.start();
    }
}
